package cn.kgc.tangcco.work01_10.controller;

import cn.kgc.tangcco.work01_10.pojo.Classes;
import cn.kgc.tangcco.work01_10.service.ClassesService;
import cn.kgc.tangcco.work01_10.vo.ClassesVo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class ClassesController {
    @Resource
    private ClassesService classesService;

    @GetMapping("/select2")
    public ClassesVo select() {
        ClassesVo classesVo = new ClassesVo();
        try {
            List<Classes> classess= classesService.selectss();
            classesVo.setList(classess);
            classesVo.setMsg("");
            classesVo.setStatus(true);
        } catch (Exception e) {
            e.printStackTrace();
            classesVo.setMsg(e.getMessage());
            classesVo.setStatus(false);
        }
        return classesVo;
    }

}
